//
// Created by luosong on 15/8/26.
// Copyright (c) 2015 CHANJET. All rights reserved.
//

#import <Foundation/Foundation.h>

@class CSPNetworkingRequest;

@protocol CSPUrlFilterProtocol <NSObject>
- (NSString *)filterUrl:(NSString *)originUrl withRequest:(CSPNetworkingRequest *)request;
@end

@protocol CSPCacheDirPathFilterProtocol <NSObject>
- (NSString *)filterCacheDirPath:(NSString *)originPath withRequest:(CSPNetworkingRequest *)request;
@end

@interface CSPNetworkConfig : NSObject

+ (instancetype)sharedInstance;

@property (nonatomic, readonly) NSURL *URL;
@property (nonatomic, strong) NSURL *baseURL;
@property (nonatomic, strong) NSString *URLString;
@property (nonatomic, strong) NSDictionary *headers;

@property (strong, nonatomic) NSString *cdnUrl;
@property (strong, nonatomic, readonly) NSArray *urlFilters;
@property (strong, nonatomic, readonly) NSArray *cacheDirPathFilters;

- (void)addUrlFilter:(id<CSPUrlFilterProtocol>)filter;
- (void)addCacheDirPathFilter:(id <CSPCacheDirPathFilterProtocol>)filter;

@end